package com.ymatou.iapi.godmch.service;

import java.util.List;

import net.sf.json.JSONArray;

import org.json.JSONException;
import org.json.JSONObject;

import com.ymatou.iapi.godmch.parameter.mchInfo;
import com.ymatou.iapi.godmch.parameter.parentInfo;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*获取商户信息(头像,名称,微信号)Call
*FreeMaker Template自动生成代码
*/
public class simplemchCall extends YmatouBaseCall{
	private static String opurl ="api/mch/simple";
	
	public simplemchCall() {
		super(EnvSetup.getSystemUrl("godmch_iapi"),opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	
	 public String getStatus1()
		{
			  return getString("status");
		}
			
	    public String getMessage()
		{
			 return getString("msg");
		}
	    
	    public mchInfo getMchInfo() {
	    	mchInfo data = null;
			try {
				data = (mchInfo) FormatUtil.GSONToObject(getString("result").toString(), mchInfo.class);

			} catch (Exception e) {
				e.printStackTrace();
			}
			return data;
		}
}